import java.io.File;
import java.util.Vector;

import org.autoparser.ZParser;
import org.autoparser.exttree.ZDataContainer;
import org.autoparser.exttree.ZDataContainer.PairIterator;
import org.autoparser.exttree.exception.ZOddPageException;
import org.dom4j.DocumentException;
import org.htmlparser.util.ParserException;

public class MainClass {
	public static void main(String[] args) throws DocumentException, ParserException, ZOddPageException{
//		ZParser p = new ZParser(new File(".\\example\\data\\extraction.xml"),true);
//		ZDataContainer datac1 = new ZDataContainer(),datac2 = new ZDataContainer();
//		p.extractInfo(new File(".\\example\\data\\a.html"),datac1);
//		p.extractInfo(new File(".\\example\\data\\a.html"),datac2);
//		for(String key: datac2.getSubContainer("org").keySet())
//			System.out.println(key + " : " + datac2.getSubContainer("org").get(key));
//		System.out.println("---------------------------------------");
//		for(PairIterator it = datac2.getIterator("org");it.hasNext();){
//			Vector<String> vct = it.next();
//			System.out.println(vct.toString());
//		}
		ZParser p = new ZParser(new File("F:\\hoho\\reg.xml"),true);
		ZDataContainer datac1 = new ZDataContainer();
		p.extractInfo("F:\\hoho\\reut2-001.sgm",datac1);
//		for(String key: datac1.getSubContainer("doc").keySet())
//			System.out.println(key + " : " + datac1.getSubContainer("topic").get(key));
		System.out.println("---------------------------------------");
		for(PairIterator it = datac1.getIterator("doc");it.hasNext();){
			Vector<String> vct = it.next();
			System.out.println(vct.toString());
		}
	}
}